package com.demo.prototype.improve;

public class Client {

    public static void main(String[] args) throws CloneNotSupportedException {
        System.out.println("使用原型模式完成克隆");
        Sheep sheep = new Sheep("tom", 1, "red");

        Sheep friend = new Sheep("jack", 2, "write");
        sheep.setFriend(friend);

        System.out.println(sheep);

        Sheep clone = (Sheep) sheep.clone();
        System.out.println(clone);
    }
}
